<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
    <style>
    </style>
</head>
<body>
    <!-- 插槽中使用template v-slot -->
    <div id="app">
        <main-page>
                <template #s1>
                    <div>
                        首页
                    </div>
                </template>

        </main-page>
        
    </div>
    <script>
     Vue.component("mainPage",{
        template:`
            <div>
            <slot name="s1"></slot>
            </div>
        `,
    })
    Vue.component("goods",{
        template:`
            <div>
                商品
            </div>
        `,
    })
    Vue.component("detail",{
        template:`
            <div>
                详情
            </div>
        `,
    })
        const app = new Vue({
            el:"#app",
            data: {
                page:"mainPage"
            }

        });

    </script>
</body>
</html>